import { ModuleComponentType } from '../components/resume-detail/template/module-component.enum';

interface TemplateProjectExperience {
    name: string;
    role: string;
    from: string;
    to: string;

    description: string;

    achievements: string[];
    skills: string[];
}

interface TemplateEducationExperience {
    schoolName: string;

    isFullTime: boolean;

    educationBackground: '初中及以下' | '中专/中技' | '高中' | '大专' | '本科' | '硕士' | '博士';

    fromYear: number;
    toYear?: number;

    major: string;
    experiences: string[];
    subjects?: string[];
}

interface TemplateWorkExperience {
    industry: string;
    department: string;
    position: string;
    companyName: string;
    salary?: number;
    from: string;
    to?: string;
    experiences: string[];
    achievements: string[];
    skills: string[];
}

interface TemplateSpecialExperience {
    name: string;
    start: string;
    end?: string;

    description: string;
}

interface TemplatePersonalInfo {
    avatar: string;
    name: string;
    gender: '男' | '女';
    birthday: string;

    emailAddress: string;
    phoneNumber: string;

    /**
     * must be a domain name
     */
    socialHomePage?: string;

    startWorkWhen?: string;

    currentResidence: string;

    hobbies?: string[];

    internshipExperiences?: TemplateWorkExperience[];

    advances?: string[];

    jobStatus?: '离职-随时到岗' | '在职-暂不考虑' | '在职-考虑机会' | '在职-月内到岗';

    expectCity: string;
    expectedLowestSalary: number;
    expectedHighestSalary: number;
    expectPosition: string;
}

type TemplateDetailModuleContent =
    | TemplateWorkExperience
    | TemplateEducationExperience
    | TemplateProjectExperience
    | TemplateSpecialExperience;
// | { [key: string]: string };

interface TemplateDetailModule {
    moduleComponentType?: ModuleComponentType;
    name: string;
    priority: number;
    content: TemplateDetailModuleContent;
}

interface TemplateDetailData {
    personalInfo: TemplatePersonalInfo;

    modules: TemplateDetailModule[];
}

interface TemplateDetailInitData {
    name: string;
    data: TemplateDetailData;
    style?: string;
}

export {
    TemplateProjectExperience,
    TemplateEducationExperience,
    TemplateWorkExperience,
    TemplateSpecialExperience,
    TemplatePersonalInfo,
    TemplateDetailModuleContent,
    TemplateDetailModule,
    TemplateDetailData,
    TemplateDetailInitData,
};
